package pojo;


import java.util.Objects;

public class Brand {
    //属性
    private int brandNum;
    private String brandName;
    private String remark;
    //get set 构造函数

    public static Brand valueOf(String str){
        Brand brand = new Brand();
        try {
            String strs[] = new String[3];
            strs = str.split("/");
            brand.brandNum = Integer.valueOf(strs[0]);
            brand.brandName = strs[1];
            brand.remark = strs[2];

        }catch (Exception e){
            e.printStackTrace();
            throw e;
        }finally {
            return brand;
        }
    }

    public Brand() {
    }

    public Brand(int brandNum, String brandName, String remark) {
        this.brandNum = brandNum;
        this.brandName = brandName;
        this.remark = remark;
    }

    public int getBrandNum() {
        return brandNum;
    }

    public void setBrandNum(int brandNum) {
        this.brandNum = brandNum;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    @Override
    public String toString() {
        return "Brand{" +
                "brandNum=" + brandNum +
                ", brandName='" + brandName + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Brand brand = (Brand) o;
        return brandNum == brand.brandNum &&
                Objects.equals(brandName, brand.brandName) &&
                Objects.equals(remark, brand.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(brandNum, brandName, remark);
    }


}
